package com.hw.paltfrom.controller.casemain;

import java.util.Map;

import com.hw.paltfrom.pojo.HwCaseMain;
import com.hw.paltfrom.pojo.HwCaseSiteoper;
import com.hw.paltfrom.vo.StationCaseFileVo;
import com.hw.paltfrom.vo.StepInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hw.paltfrom.pack.ResponseResult;
import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.casemain.StationCasemainServer;
import com.hw.paltfrom.utils.VerifyUtil;
import com.hw.paltfrom.vo.StationCaseMainVo;

@RestController
@RequestMapping(value = "/StationCasemain")
public class StationCasemainController {
	
	@Autowired
	private StationCasemainServer stationCasemainServer;
	
	
	 @RequestMapping(value = "/query")
	    public Map<String, Object> standQuery(StationCaseMainVo vo) {
	        Boolean flag = VerifyUtil.verifyParams(vo);
	        if (!flag) {
	            return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
	        }
	        return stationCasemainServer.query(vo);
	    }
	/**
	 * 超限站（执法监管）---立案
	 * @param
	 * @return put on record
	 */
	@RequestMapping(value = "/putOnRecord")
	public Map<String, Object> standRemote( @RequestBody StationCaseMainVo caseMainVo ) {
		if (caseMainVo.getVo().getfCaseid()!=null&&caseMainVo.getVo().getfOverruncode()!=null&&caseMainVo.getVo().getfAjCrtstep()!=null){
			return stationCasemainServer.putOnRecord(caseMainVo);
		}else {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
	}
	/**
	 * 超限站（执法监管）---修改
	 * @param
	 * @return put on record
	 */
	@RequestMapping(value = "/revamp")
	public Map<String, Object> revamp(@RequestBody StationCaseFileVo vo) {
		return stationCasemainServer.revamp(vo);
	}

	/**
	 * 超限站（执法监管）---案件文书上传
	 * @param
	 * @return put on record
	 */
	@RequestMapping(value = "/uploadDocuments")
	public Map<String, Object> uploadDocuments(HwCaseMain vo) {
		if (vo.getfCaseid()!=null){
			return stationCasemainServer.uploadDocuments(vo);
		}else {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
	}
	/**
	 * 超限站（执法监管）---放行确认
	 * @param
	 * @return put on record
	 */
	@RequestMapping(value = "/releaseConfirmation")
	public Map<String, Object>  releaseConfirmation(@RequestBody StepInfoVO vo) {

		return stationCasemainServer.releaseConfirmation(vo);

	}
	/**
	 * 超限站（执法监管）---放行说明
	 * @param
	 * @return put on record
	 */
	@RequestMapping(value = "/releaseInstructions")
	public Map<String, Object>  releaseInstructions(@RequestBody StepInfoVO vo) {

		return stationCasemainServer.releaseInstructions(vo);

	}
	
	@RequestMapping(value = "/findFile")
	public Map<String, Object>  findFile(String caseid) {
		return stationCasemainServer.findFile(caseid);
	}
}
